<HTML><HEAD><TITLE>alldifferent(?List)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(sd)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>alldifferent(?List)</H1>
All elements of List are different
<DL>
<DT><EM>List</EM></DT>
<DD>List of domain variables or atomic values
</DD>
</DL>
<H2>Description</H2>
<P>
	Constrains all list elements to be different atomic values.
	At call time, the list elements must already have domains or
	be instantiated.
	</P><P>
	Operationally, the predicate delays until list elements become
	instatiated, and removes the corresponding values from the domains
	of the other list elements.
	</P>

<H2>Examples</H2>
<PRE>
    ?- [X, Y, Z] &amp;:: [a,b,c,d], alldifferent([X,Y,Z]), X = a.
    X = a
    Y = Y{[b, c, d]}
    Z = Z{[b, c, d]}
    There are 2 delayed goals.
    Yes (0.00s cpu)

    ?- X &amp;:: [a,b,c], alldifferent([a,b,X]).
    X = c
    Yes (0.00s cpu)
    </PRE>
<H2>See Also</H2>
<A HREF="../../lib/sd/YRE-2.html">&\= / 2</A>
</BODY></HTML>
